<template>
  <div class="page platformdetails">
    <div class="bread">
      <el-breadcrumb separator="/" class="datails_nav">
        <el-breadcrumb-item :to="{ path: '/' }"
          ><el-icon><HomeFilled /></el-icon>首页</el-breadcrumb-item
        >
        <el-breadcrumb-item :to="{ path: '/product/sku' }"
          >科研平台</el-breadcrumb-item
        >
        <el-breadcrumb-item>平台详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="mainbox">
      <!-- 介绍 -->
      <div class="mainbox_top">
        <div class="elimg">
          <img src="https://chengguo-1309318813.cos.ap-beijing.myqcloud.com/uploads/zizhi/qiye/21791717381735_.pic.jpg" alt="" />
        </div>
        <div class="mainbox_top_right">
          <div class="mainbox_top_right_top">
            <div>
              <p class="title">国家小麦工程技术研究中心</p>
            </div>
          </div>
          <div class="mainbox_top_right_content">
            <el-row>
              <el-col :span="10">
                <p class="samewidth">地址：河南省郑州市农业路62号</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">邮编：450000</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">单位性质：企业</p>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <p class="samewidth">注册资金（万元）：200</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">注册年份：2018</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">备案年份：2023</p>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <p class="samewidth">研发类型：小麦种植</p>
              </el-col>
              <el-col :span="24">
                <p class="samewidth">技术领域：现代农业</p>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
      <!-- 单位介绍 -->
      <div class="reasultdetail">
        <div class="title">单位介绍</div>
        <el-divider />
        <p class="">
          国家小麦工程技术研究中心，1996年经国家科技部批准，由河南省科技厅主管，依托河南农业大学组建，2000年通过验收并正式命名。国家小麦工程技术研究中心下设科学研究部、开发经营部、办公室以及小麦生理生态、小麦生育调控与生物技术、小麦遗传育种等研究室和品种分析实验室， 并建有河南国家小麦工程技术开发有限公司、优质小麦实验加工基地、农业智能化研究所等下属企业和2 0 余个试验站和示范基地。
        </p>
      </div>

      <!-- 相关成果 -->
      <div class="aboutrequire">
        <div class="title">相关成果</div>
        <el-divider />
        <div class="aboutrequirebox">
          <div
            class="aboutrequirebox_item pointer xuqiu"
            @click="toachdetail(i.id)"
            v-for="i in userachlist"
          >
            <!-- <img :src="i.achImage.path" alt=""> -->
            <el-image class="elimg" :src="i.achImage.path">
              <template #error>
                <div class="image-slot">
                  <img class="elimg" src="/src/assets/resultimg.png" alt="" />
                </div>
              </template>
            </el-image>
            <div class="xq-box">
              <p class="title hidden-1">{{ i.achName }}</p>
              <p class="grey hidden-1">
                合作方式：
                <span v-for="item in i.converMethod">{{ item }}</span>
                <!-- {{ i.converMethod }} -->
              </p>
              <p class="grey">
                项目阶段：
                <span v-for="item in i.technicalMaturity">{{ item }}</span>
              </p>
            </div>
          </div>
        </div>
      </div>

      <!-- 相关需求 -->
      <div class="aboutrequire">
        <div class="title">相关需求</div>
        <el-divider />
        <div class="aboutrequirebox">
          <div
            class="aboutrequirebox_item xuqiu pointer"
            @click="todemdetail(i.id)"
            v-for="i in userdemlist"
          >
            <!-- <img :src="i.demImage.path" alt=""> -->
            <el-image class="elimg" :src="i.demImage.path">
              <template #error>
                <div class="image-slot">
                  <img class="elimg" src="/src/assets/requireimg.png" alt="" />
                </div>
              </template>
            </el-image>
            <div class="xq-box">
              <p class="title hidden-1">{{ i.demName }}</p>
              <p class="grey">预算资金：{{ i.finance }}万</p>
              <p class="grey hidden-1">
                技术领域：
                <span v-for="item in i.field">{{ item }}，</span>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { ArrowRight, HomeFilled } from "@element-plus/icons-vue";
import { getteacherdetail, getuserach, getuserdem } from "@/api/user/index";
const route = useRoute();
const $router = useRouter();
let id = '1797110519417556993';
onMounted(() => {
  console.log(route.query.id);
});

const toachdetail = (id: any) => {
  $router.push({
    path: "/acl/achievementdetail",
    query: {
      id: id,
    },
  });
};

const todemdetail = (id: any) => {
  $router.push({
    path: "/product/requiredetail",
    query: {
      id: id,
    },
  });
};

//用户成果列表
const userachlist: any = ref([]);
getuserach(id).then((res) => {
  res.data.records.map((item) => {
    return (item.achImage = JSON.parse(item.achImage));
  });
  // res.data.records.map(item=>{
  //   return item.converMethod = JSON.parse(JSON.stringify(item.converMethod))
  // })

  userachlist.value = res.data.records;
});

//用户需求列表
const userdemlist: any = ref([]);
getuserdem(id).then((res) => {
  res.data.records.map((item) => {
    return (item.demImage = JSON.parse(item.demImage));
  });
  res.data.records.map((item) => {
    return (item.field = JSON.parse(item.field));
  });
  userdemlist.value = res.data.records;
});

</script>


<style lang="scss" scoped>
@mixin flex {
  display: flex;
  align-items: center;
}

.page {
  width: 100%;

  .bread {
    max-width: 1400px;
    box-sizing: border-box;
    margin: 0 auto;
  }
}

.platformdetails .mainbox {
  width: 1460px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.06);
  opacity: 1;
  border-radius: 0;
  margin: 0 auto;
  padding: 35px 30px;
  background: #fff;
  border-radius: 10px;
  border: none;
  margin-bottom: 60px;
  .title {
    font-size: 20px;
    font-weight: bold;
  }
  .title {
    font-size: 26px;
    font-family: Microsoft YaHei;
    font-weight: 700;
    color: #333;
    opacity: 1;
    margin-bottom: 14px;
  }
  .mainbox_top {
    @include flex();
    align-items: flex-start;
    .elimg {
      width: 420px;
      height: 226px;
      overflow: hidden;
      img {
        width: 100%;
        vertical-align: bottom;
      }
    }

    .mainbox_top_right {
      margin-left: 40px;
      width: calc(100% - 420px);
    }

    .mainbox_top_right_top {
      @include flex();
      justify-content: space-between;
      width: 100%;
      .title {
        font-size: 26px;
        font-family: Microsoft YaHei;
        font-weight: 700;
        color: #333;
        opacity: 1;
        margin-bottom: 14px;
      }
      .belong {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        opacity: 1;
        margin-bottom: 16px;
      }
      .twobtn {
        color: #fff;
        text-align: center;
        @include flex;

        .collect {
          background-color: rgb(254, 130, 9);
          width: 80px;
          height: 30px;
          line-height: 30px;
          font-size: 14px;
        }

        .liuyan {
          background-color: rgb(5, 96, 263);
          width: 80px;
          height: 30px;
          line-height: 30px;
          font-size: 14px;
        }
      }
    }

    .mainbox_top_right_content {
      font-size: 16px;
      p {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        opacity: 1;
        margin-top: 14px;
      }
    }
  }

  .reasultdetail {
    margin-top: 37px;

    p {
      font-size: 18px;
      line-height: 32px;
      color: #4a4a4a;
      font-weight: 400;
    }
  }

  .aboutrequire {
    margin-top: 37px;
    .title {
      margin-left: 4px;
      font-size: 28px;
      font-family: Microsoft YaHei;
      font-weight: 700;
      line-height: 32px;
      color: #333;
      opacity: 1;
    }
    .aboutrequirebox {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      .aboutrequirebox_item {
        &.xuqiu {
          width: 431px;
          height: 375px;
          background: #fff;
          box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
          opacity: 1;
          border-radius: 0;
          margin-bottom: 24px;
          .elimg {
            width: 431px;
            height: 233px;
          }
          .xq-box {
            padding: 24px;
            .title {
              width: 383px;
              font-size: 26px;
              font-family: Microsoft YaHei;
              font-weight: 700;
              color: #4a4a4a;
              opacity: 1;
              margin-bottom: 16px;
            }
            .grey {
              width: 100%;
              font-size: 14px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #c9c9c9;
              opacity: 1;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              span {
                font-family: Microsoft YaHei;
                font-weight: 400;
                line-height: 26px;
                color: #8b8b8b;
                opacity: 1;
              }
            }
          }
        }
        .elimg {
          width: 290px;
          height: 130px;
        }

        .grey {
          color: #999;
          font-size: 14px;
        }
      }
    }

    .contentitem {
      padding: 20px;
      margin: 20px;
      background: url("../../assets/首页/technology.png");
      width: 30%;
      background-size: 100% 100%;
      display: flex;
    }

    img {
      width: 100px;
      height: 130px;
    }

    .contentitem_text {
      font-size: 16px;

      .level {
        color: #999;
      }
    }
  }
}
</style>
